#define _CRT_SECURE_NO_WARNINGS 1
#include"Sort.h"
void printarr(int* a, int n)
{
	for (int i = 0; i < n; i++)
	{
		printf("%d ", a[i]);
	}
	printf("\n");
}
void TestSelectSort()
{
	int a[] = { 5,2,3,1 };
	SelectSort(a,sizeof(a)/sizeof(int));
	printarr(a, sizeof(a) / sizeof(int));

}
void TestHeapSort()
{
	int a[] = { 5,2,3,1 };
	HeapSort(a, sizeof(a) / sizeof(int));
	printarr(a, sizeof(a) / sizeof(int));

}
void TestBubbleSort()
{
	int a[] = { 8,4,6,2,9,0,98,453,1,42424,5556,231,1,2,56,7,9,5555,22 };
	BubbleSort(a, sizeof(a) / sizeof(int));
	printarr(a, sizeof(a) / sizeof(int));

}
void TestPartSort1()
{
	int a[] = { 5,3,6,5,7,8,1,3,2,5 };
	PartSort1(a, 0, sizeof(a) / sizeof(int) - 1);
	printarr(a, sizeof(a) / sizeof(int));

 }
void TestQuickSort()
{
	int a[] = { 6,1,2,4,8,9,6,7,5,2,3,1 };

	QuickSort(a, 0, sizeof(a) / sizeof(int) - 1);
	printarr(a, sizeof(a) / sizeof(int));

}
void TestQuickSortNonR()
{
	int a[] = { 8,4,6,2,9,0,98,453,1,42424,5556,231,1,2,56,7,9,5555,22,2,3,1 };

	QuickSortNonR(a, 0, sizeof(a) / sizeof(int) - 1);
	printarr(a, sizeof(a) / sizeof(int));
}
int main()
{
	TestHeapSort();
	//TestBubbleSort();
	//TestPartSort1();
	//TestQuickSort();
	//TestQuickSortNonR();
	return 0;
}